package com.hakim.wfb.customer.enums;

/**
 * 支付状态
 * Created by caochong on 2016/6/13.
 */
public enum PayStatusEnum {
    NOT_PAY("0", "not_pay"),//未支付
    PAYED("1", "payed"),//已支付
    TIME_OUT("2", "time_out"),//支付超时
    CANCEL("3", "cancel"),//订单取消
    ;

    private String code;

    private String message;

    private PayStatusEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    public static PayStatusEnum getByCode(String code) {
        PayStatusEnum[] codes = values();
        for (PayStatusEnum each : codes) {
            if (each.code.equals(code)) {
                return each;
            }
        }
        return null;
    }
}
